//
//  UIButton+SWButton.m
//  sc-cyan-ios
//
//  Created by lvjian01 on 2017/12/22.
//  Copyright © 2017年 greenbuilding. All rights reserved.
//

#import "UIButton+SWButton.h"

@implementation UIButton (SWButton)

//+ (instancetype)buttonWithImage:(NSString *)image highImage:(NSString *)hightImage title:(NSString *)title target:(id)target action:(SEL)action{
//    
//    
//    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
//    [button setBackgroundColor:[UIColor redColor]];
//    button.contentMode = UIViewContentModeScaleAspectFit;
//    
//    if (image) {
//        [button setImage:[UIImage imageNamed:image] forState:UIControlStateNormal];
//    }
//    
//    if (hightImage) {
//        [button setImage:[UIImage imageNamed:hightImage] forState:UIControlStateHighlighted];
//    }
//    
//    [button setTitleColor:UIColorFromRGB(0x808080) forState:UIControlStateNormal];
//    [button.titleLabel setFont:SYSTEMFONT(13)];
//    [button setTitle:title forState:UIControlStateNormal];
//    [button addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
//    
//    button.imageView.frame = CGRectMake(0, 0, button.currentImage.size.width, button.currentImage.size.height);
//    button.titleLabel.frame = CGRectMake(button.currentImage.size.width, 0, title.length*18, kTopBarHeight);
//    
////    button.contentEdgeInsets = UIEdgeInsetsMake(0, 10, 0, 0);
////    button.titleEdgeInsets = UIEdgeInsetsMake(0, 10, 0, 0);
////    button.frame = CGRectMake(0, 0, button.titleLabel.width + button.titleLabel.x, kTopBarHeight);
//    
//    [button.imageView mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.edges.top.left.bottom.equalTo(0);
//        make.edges.right.mas_equalTo(10);
//    }];
//    
//    [button.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.edges.top.right.bottom.equalTo(0);
//    }];
//    
//    NSLog(@"%@,%@",@(button.width),@(button.titleLabel.width+button.titleLabel.x));
//    
//    return button;
//}

@end
